<article class="module width_full">
    <header><h3>{#reports#}</h3></header>
	<table width="100%" cellpadding="3" cellspacing="1">
		<tbody><tr>
		<td class="header" style="font-weight:bold;">{#new_reports#}: {$new_reports}</td>
		</tr>
	</tbody></table>
	<table width="100%" cellpadding="3" cellspacing="1">
		<tr>
			<th align="center" class="header">{#username#}</th>
			<th align="center" class="header">{#date#}</th>
			<th align="center" class="header">{#reason#}</th>
			<th align="center" class="header">{#stars#}</th>
			<th align="right" class="header">{#action#}</th>
		</tr>
                {if !empty($new_value)}
                    {foreach from=$new_value item=item}
                            {literal}
                            <script type="text/javascript">
                                    $(function() {
                                            $(".inv_button_new_{/literal}{$item.id}{literal}").click(function() {
                                                    var id 					= '{/literal}{$item.id}{literal}';
                                                    var dataString	= 'creport='+ id;
                                                    var parent = $(this).parent();
                                            $.ajax({
                                                    type: "POST",
                                                    url: "_javascript/ajax_livedit.php",
                                                    data: dataString,
                                                    cache: false,
                                                    success: function()
                                                            {
                                                                    $("#maininv_new_{/literal}{$item.id}{literal}").fadeOut('slow', function() {$("#maininv_new_{/literal}{$item.id}{literal}").remove();});
                                                            }
                                            });
                                            return false;
                                            });
                                    });
                            </script>
                            {/literal}
                            <tr id="maininv_new_{$item.id}">
                                    <td align="center" class="body"><a style="font-weight:bold; color:#000000;" href="index.php?mod=profile&userID={$item.userID}">{$item.username} ({$item.allstars} {#stars#})</a></td>
                                    <td align="center" class="body">{$item.timestamp}</td>
                                    <td align="center" class="body">{$item.reason}</td>
                                    <td align="center" class="body">{$item.img}</td>
                                    <td align="right" class="body"><a href="" class="inv_button_new_{$item.id}"><img src="_images/icons/cross.png" alt=""></a></td>
                            </tr>
							{if $item.allstars >= 5}
								<tr>
									<td class="body" colspan="5">{#banish#} - <a href="index.php?mod=banlist&page=add&username={$item.username}&reason={#res#}">{#banplayer#}</a></td>
								</tr>
							{/if}
                    {/foreach}
                {/if}
	</table>
		
	<table width="100%" cellpadding="3" cellspacing="1">
		<tbody><tr>
		<td class="header" style="font-weight:bold;">{#old_reports#}: {$old_reports}</td>
		</tr>
	</tbody></table>
	<table width="100%" cellpadding="3" cellspacing="1">
		<tr>
			<th align="center" class="header">{#username#}</th>
			<th align="center" class="header">{#date#}</th>
			<th align="center" class="header">{#reason#}</th>
			<th align="center" class="header">{#stars#}</th>
			<th align="right" class="header">{#action#}</th>
		</tr>
                {if !empty($old_value)}
                    {foreach from=$old_value item=item}
                            {literal}
                            <script type="text/javascript">
                                    $(function() {
                                            $(".inv_button_old_{/literal}{$item.id}{literal}").click(function() {
                                                    var id 					= '{/literal}{$item.id}{literal}';
                                                    var dataString	= 'creport='+ id;
                                                    var parent = $(this).parent();
                                            $.ajax({
                                                    type: "POST",
                                                    url: "_javascript/ajax_livedit.php",
                                                    data: dataString,
                                                    cache: false,
                                                    success: function()
                                                            {
                                                                    $("#maininv_old_{/literal}{$item.id}{literal}").fadeOut('slow', function() {$("#maininv_old_{/literal}{$item.id}{literal}").remove();});
                                                            }
                                            });
                                            return false;
                                            });
                                    });
                            </script>
                            {/literal}
                            <tr id="maininv_old_{$item.id}">
                                    <td align="center" class="body"><a style="font-weight:bold; color:#000000;" href="index.php?mod=profile&userID={$item.userID}">{$item.username} ({$item.allstars} {#stars#})</a></td>
                                    <td align="center" class="body">{$item.timestamp}</td>
                                    <td align="center" class="body">{$item.reason}</td>
                                    <td align="center" class="body">{$item.img}</td>
                                    <td align="right" class="body"><a href="" class="inv_button_old_{$item.id}"><img src="_images/icons/cross.png" alt=""></a></td>
                            </tr>
							{if $item.allstars >= 5}
								<tr>
									<td class="body" colspan="5">{#banish#} - <a href="index.php?mod=banlist&page=add&username={$item.username}&reason={#res#}">{#banplayer#}</a></td>
								</tr>
							{/if}
                    {/foreach}
                {/if}
	</table>
	<footer>
		<div class="submit_link">
			<a href="index.php?mod=creport&amp;page=add"><input type="submit" value="{#add_report#}" class="alt_btn"></a>
		</div>
	</footer>
</article>